import {
	request,
	requestData
} from "../Promise.js"
export default {
	/**
	 * @param sysType 移动端类型  1：android  2：IOS
	 * @param vInfo 版本信息 （年.月.次版本号.修订号）
	 * @param appType app类型  1：企业端app  2:监督手机管理app
	 */
	getNewByApp(sysType, vInfo, appType) {
		return request({
			url: 'data-dispatch/appUpgrade/getNewByApp',
			method: 'get',
			data: {
				sysType,
				vInfo,
				appType
			}
		})
	},
	// 获取字典值
	getDict(data) {
		return request({
			url: 'blade-system/dict/list',
			method: 'get',
			data,
		})
	},
	//获取验证码
	getCode(data, header) {
		return request({
			url: 'blade-auth/oauth/captcha',
			method: 'get',
			data,
			header,
		})
	},
	//首页获取任务列表
	getTaskList(data) {
		return request({
			url: 'qy-server/busitask/ecertPage',
			method: 'get',
			data,
		})
	},




	//首页获取运单列表
	getWaybillList(data) {
		return request({
			url: 'qy-server/busibill/page',
			method: 'get',
			data,
		})
	},


	//登录
	login(data, header) {
		return request({
			url: 'blade-auth/oauth/token?tenantId=' + data.tenantId + "&username=" + data.username +
				"&password=" +
				data.password + "&grant_type=" + data.grant_type + "&scope=" + data.scope + "&type=" + data
				.type,
			method: 'post',
			header
		})
	},
	getReason() {
		// 获取活动事由
		return requestData([{
			"value": "1",
			"text": "车辆维修"
		}, {
			"value": "2",
			"text": "普通运输"
		}, {
			"value": "3",
			"text": "车辆年检"
		}, {
			"value": "4",
			"text": "罐体检验"
		}, {
			"value": "5",
			"text": "车辆保养"
		}, {
			"value": "6",
			"text": "非民用运输"
		},{
						"value": "7",
						"text": "空车运行"
					},{
						"value": "8",
						"text": "其他"
					}]);
	},

	//我的车辆  驾押
	myCarJy(data) {
		return request({
			url: 'qy-server/app/basevehiclecrew/getByIdNumber',
			method: 'get',
			data,
		})
	},
	//我的车辆
	myCarQy(data) {
		return request({
			url: 'qy-server/basevehicle/getMyVehByOwnerId',
			method: 'get',
			data,
		})
	},
	//我的企业
	myQy(data) {
		return request({
			url: 'qy-server/baseowner/detail',
			method: 'get',
			data,
		})
	},

	//我的证件
	myZj(data) {
		return request({
			url: 'qy-server/app/basePractCert/getByIdNumber',
			method: 'get',
			data,
		})
	},
	// 人员类型
	queryEmpType(data) {
		return request({
			url: 'qy-server/baseempinfo/queryEmpType',
			method: 'get',
			data,
		})
	},
	//任务详情
	taskDatail(data) {
		return request({
			url: 'qy-server/busitask/detail',
			method: 'get',
			data,
		})
	},

	//运单详情
	busibillDatail(data) {
		return request({
			url: 'qy-server/busibill/detail',
			method: 'get',
			data,
		})
	},
	// 修改运单装卸货信息
	updateBillTypeAndAddr(data) {
		return request({
			url: 'qy-server/busibill/updateBillTypeAndAddr',
			method: 'post',
			data,
		})
	},
	//运单修改-提交
	busibillSubmit(data) {
		return request({
			url: 'qy-server/busibill/submit',
			method: 'post',
			data,
		})
	},
	// 运单修改-
	busibillUpdate(data) {
		return request({
			url: 'qy-server/busibill/update',
			method: 'post',
			data,
		})
	},
	//运单详情-行车日志
	mgntvehrunlogPage(data) {
		return request({
			url: 'qy-server/mgntvehrunlog/page',
			method: 'get',
			data,
		})
	},
	// 运单详情-检查项
	listNoPage(data) {
		return request({
			url: 'qy-server/basecheckdict/app/listNoPage',
			method: 'get',
			data,
		})
	},
	// 运单详情-提交检查
	mgntvehrunlogSave(data) {
		return request({
			url: 'qy-server/mgntvehrunlog/save',
			method: 'post',
			data,
		})
	},

	//应急电话列表
	phoneList(data) {
		return request({
			url: 'qy-server/baseemetel/page',
			method: 'get',
			data,
		})
	},

	//应急电话列表
	qyTaskList(data) {
		return request({
			url: 'qy-server/busitask/ecertPage',
			method: 'get',
			data,
		})
	},
	//创建任务-驾押获取运输信息
	createTaskgetYs(data) {
		return request({
			url: 'qy-server/app/basevehiclecrew/getDefaultInformationByIdNumber',
			method: 'get',
			data,
		})
	},
	//创建任务-运输信息-获取车牌号
	YsVechCode(data) {
		return request({
			url: 'qy-server/app/basevehiclecrew/getVehicleByIdNumber',
			method: 'get',
			data,
		})
	},


	//创建任务-运输信息-获取挂车牌号
	YsGVechCode(data) {
		return request({
			url: 'qy-server/basevehicle/baseVehicleList',
			method: 'get',
			data,
		})
	},

	//驾押人员信息
	JYPerson(data) {
		return request({
			url: 'qy-server/app/basevehiclecrew/getPersonByVehicle',
			method: 'get',
			data,
		})
	},


	//获取货物名称
	getGoodsName(data) {
		return request({
			url: 'qy-server/app/task/getGoodsName',
			method: 'get',
			data,
		})
	},

	//获取车辆的货物名称
	getVehGoodsName(data) {
		return request({
			url: 'qy-server/basevehiclegoods/page',
			method: 'get',
			data,
		})
	},



	//获取托运方、装货方、收货方信息
	getTzs(data) {
		return request({
			url: 'qy-server/basecorpcust/page',
			method: 'get',
			data,
		})
	},

	//获取所在地区
	getAdr(data) {
		return request({
			url: 'blade-system/region/lazy-tree',
			method: 'get',
			data,
		})
	},
	//获取经纬度
	getLocation(data) {
		return request({
			url: 'https://restapi.amap.com/v3/geocode/geo',
			method: 'get',
			data,
		})
	},
	//两地的距离
	getJuli(data) {
		return request({
			url: 'https://restapi.amap.com/v3/direction/driving?origin=' + data.origin +
				'&destination=' + data.destination +
				'&output=' + data.output +
				'&waypoints=' + data.waypoints +
				'&key=' + data.key,
			// url: 'https://restapi.amap.com/v5/direction/driving?origin=118.200692,39.624437&destination=113.130769,40.109395&waypoints=""&key=a5b6c60bf58424fbaaf0f4955ac9058a',
			method: 'get',
			// data,
		})
	},

	// 获取车牌号列表
	matchVehList(data) {
		return request({
			hideLoad: true,
			url: 'qy-server/basevehicle/matchVehList',
			method: 'post',
			data,
		})
	},
	//获取途径路线集合
	getLineName(data) {
		return request({
			url: 'qy-server/baseownerline/list',
			method: 'get',
			data,
		})
	},
	//创建任务驾押验证接口
	vehCheck(data) {
		return request({
			url: 'qy-server/basevehicle/vehCheck',
			method: 'post',
			data,
		})
	},
	//驾押人员创建任务
	createTask(data) {
		return request({
			url: 'qy-server/app/busitask/save',
			method: 'post',
			data,
		})
	},

	// 活动台账增删改查
	mgntvehnotransSubmit(data) {
		return request({
			url: 'qy-server/mgntvehnotrans/submit',
			method: 'post',
			data,
		})
	},
	// 活动台账列表
	mgntvehnotransPage(data) {
		return request({
			url: 'qy-server/mgntvehnotrans/app/page',
			method: 'get',
			data,
		})
	},
	//出车前检查初始化
	ccqInit(data) {
		return request({
			url: 'qy-server/basecheckdict/app/listNoPage',
			method: 'get',
			data,
		})
	},
	//出车前检查提交 
	ccqCommit(data) {
		return request({
			url: 'qy-server/mgntvehrunlog/save',
			method: 'post',
			data,
		})
	},
	//企业人员任务提交
	qyTaskSave(data) {
		return request({
			url: 'qy-server/busitask/save',
			method: 'post',
			data,
		})
	},

	// 知识库列表
	knowledgeBaseList(data) {
		return request({
			url: 'qy-server/basedgoods617/knowledgeBase/list',
			method: 'get',
			data,
		})
	},
	// 知识库列表
	knowledgeBaseDetail(data) {
		return request({
			url: 'qy-server/basedgoods617/knowledgeBase/detail',
			method: 'get',
			data,
		})
	},
	// 消息列表
	mgntcomsglogPage(data) {
		return request({
			url: 'qy-server/mgntcomsglog/page',
			method: 'get',
			data,
		})
	},
	// 消息数量统计
	mgntcomsglogCount(data) {
		return request({
			url: 'qy-server/mgntcomsglog/count',
			method: 'get',
			data,
		})
	},
	//获取消息数量
	getMsgCount(data) {
		return request({
			url: 'qy-server/mgntcomsglog/count',
			method: 'get',
			data,
			hideLoad: true,
		})
	},
	//获取消息数量
	mgntcomsglogUpdate(data) {
		return request({
			url: 'qy-server/mgntcomsglog/update',
			method: 'post',
			data,
		})
	},
	// 人车详情     任务调度详情
	busidispcheckDetail(data) {
		return request({
			url: 'qy-server/busidispcheck/detail',
			method: 'get',
			data,
		})
	},

	//车辆调度 车牌号 挂车牌号
	ddCarMsg(data) {
		return request({
			url: 'qy-server/basevehicle/matchVehList',
			method: 'post',
			data,
		})
	},
	//企业人员查询车辆后查询是否绑定其它信息的接口
	bindCarMsg(data) {
		return request({
			url: 'qy-server/basevehicle/empVehicleBind',
			method: 'post',
			data,
		})
	},

	//任务调度驾驶员、押运员查询接口
	bindPersonMsg(data) {
		return request({
			url: 'qy-server/baseempinfo/getEmpList',
			method: 'post',
			data,
		})
	},
	//任务调度 验证挂车牌号
	yzGcar(data) {
		return request({
			url: 'qy-server/basevehicle/vehCheck',
			method: 'post',
			data,
		})
	},
	//任务调度驾驶员、押运员是否符合标准
	yzPerson(data) {
		return request({
			url: 'qy-server/baseempinfo/empCheck',
			method: 'post',
			data,
		})
	},
	//任务调度提交信息
	ddCommit(data) {
		return request({
			url: 'qy-server/busidispcheck/dispch',
			method: 'post',
			data,
		})
	},
	//企业调度详情
	ddDetail(data) {
		return request({
			url: 'qy-server/busitask/detail',
			method: 'get',
			data,
		})
	},

	//安全检查-出车前检查接口
	aqCcjc(data) {
		return request({
			url: 'qy-server/mgntvehrunlog/detail',
			method: 'get',
			data,
		})
	},

	//人车详情     任务调度详情
	carPersonDetail(data) {
		return request({
			url: 'qy-server/busidispcheck/detail',
			method: 'get',
			data,
		})
	},



	//安全检查自检
	selfCheck(data) {
		return request({
			url: 'qy-server/busidispcheck/selfCheck',
			method: 'post',
			data,
		})
	},

	//获取人工自检检查项目
	personCheck(data) {
		return request({
			url: 'qy-server/basecheckdict/app/listNoPage',
			method: 'get',
			data,
		})
	},

	//检查车辆有多少未完成运单
	checkTaskNum(data) {
		return request({
			url: 'qy-server/busidispcheck/checkTaskNum',
			method: 'get',
			data,
		})
	},

	//检查通过或不通过
	checkYorN(data) {
		return request({
			url: 'qy-server/busidispcheck/check',
			method: 'post',
			data,
		})
	},


	//任务管理取消按钮 任务管理删除按钮
	taskCancel(data) {
		return request({
			url: 'qy-server/busitask/submit',
			method: 'post',
			data,
		})
	},
	// 逆地理解析
	getAddress(params) {
		return request({
			url: 'https://restapi.amap.com/v3/geocode/regeo',
			method: 'get',
			hideLoad: true,
			data: {
				key: 'a5b6c60bf58424fbaaf0f4955ac9058a',
				output: 'json',
				location: params,
			}
		})
	},
	//危运装卸货
	//装货查询分页
	getLoadList(params) {
		return request({
			url: 'qy-server/cargoloadlist/list',
			method: 'post',
			data: params
		})
	},
	//装货详情
	getLoadDetail(params) {
		return request({
			url: 'qy-server/cargoloadlist/detail',
			method: 'post',
			data: params
		})
	},
	//装货修改 
	setLoadQuery(params) {
		return request({
			url: 'qy-server/cargoloadlist/update',
			method: 'post',
			data: {
				sourceWay: "APP",
				...params
			}
		})
	},
	//装货填报查询
	getLoadFill(params) {
		return request({
			url: 'qy-server/cargoloadlist/billRecordPage',
			method: 'post',
			data: params
		})
	},
	//装货填报
	setLoadFill(params) {
		return request({
			url: 'qy-server/cargoloadlist/save',
			method: 'post',
			data: {
				sourceWay: "APP",
				...params
			}
		})
	},

	//卸货查询分页
	getunLoadList(params) {
		return request({
			url: 'qy-server/cargodischargelist/list',
			method: 'post',
			data: params
		})
	},
	//卸货详情
	getunLoadDetail(params) {
		return request({
			url: 'qy-server/cargodischargelist/detail',
			method: 'post',
			data: params
		})
	},
	//卸货填报查询
	getunLoadFill(params) {
		return request({
			url: 'qy-server/cargodischargelist/billRecordPage',
			method: 'post',
			data: params
		})
	},
	//卸货修改
	setunLoadQuery(params) {
		return request({
			url: 'qy-server/cargodischargelist/update',
			method: 'post',
			data: {
				sourceWay: "APP",
				...params
			}
		})
	},
	//卸货填报
	setunLoadFill(params) {
		return request({
			url: 'qy-server/cargodischargelist/save',
			method: 'post',
			data: {
				sourceWay: "APP",
				...params
			}
		})
	},
	// 动态预警-数量
	warnFeedbackCount(params) {
		return request({
			url: 'data-inspection-study/insp-dynamic-warn-feedback/warn-feedback-count',
			method: 'post',
			hideLoad: true,
			data: {
				sourceWay: "APP",
				...params
			}
		})
	},
	// 动态预警-列表
	realTimeWarningFeedback(params) {
		return request({
			url: 'data-inspection-study/insp-dynamic-warn-feedback/real_time_warning_feedback',
			method: 'post',
			data: {
				sourceWay: "APP",
				...params
			}
		})
	},
	// 动态预警-反馈
	ownerFeedbackSubmit(params) {
		return request({
			url: 'data-inspection-study/insp-dynamic-warn-feedback/owner-feedback-submit',
			method: 'post',
			data: {
				sourceWay: "APP",
				...params
			}
		})
	},
	// 参数查询
	paramList(params) {
		return request({
			url: 'blade-system/param/list',
			method: 'get',
			data: {
				...params
			}
		})
	},
	// 注意事项-添加
	busitaskremarkSubmit(params) {
		return request({
			url: 'qy-server/busitaskremark/submit',
			method: 'post',
			data: {
				...params
			}
		})
	},
	// 注意事项-列表
	busitaskremarkList(params) {
		return request({
			url: 'qy-server/busitaskremark/list',
			method: 'get',
			data: {
				...params
			}
		})
	},
	// 合同接口
	listByOwner() {
		return request({
			url: 'qy-server/mgntcontract/listByOwner',
			method: 'get',
			data:{}
		})
	},
	// 修改接口
	updateBill(data) {
		return request({
			url: 'qy-server/busibill/updateBill',
			method: 'post',
			data:data
		})
	},
	// 选择地址
	pageList(params) {
		return request({
			url: 'qy-server/basecorpcust/pageList',
			method: 'get',
			data: {
				...params
			}
		})
	},
}